﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations.Schema;
using System.Data.SqlTypes;
using System.Linq;
using System.Text;
using System.Text.Json.Serialization;
using System.Threading.Tasks;

namespace store.cyt369.com.models
{
    /// <summary>
    /// 类别表
    /// </summary>
    [Table("TB_StoreCategory")]
    public class StoreCategory
    {
        public int Id { get; set; }

        /// <summary>
        /// 父级Id
        /// </summary>
        public int ParentID {  get; set; }

        /// <summary>
        /// 类别名称
        /// </summary>
        public string CategoryName { get; set; }

        /// <summary>
        /// 备注
        /// </summary>
        public string? Note {  get; set; }

        /// <summary>
        /// 顺序号
        /// </summary>
        public int OrderNumber {  get; set; }

        /// <summary>
        /// 是否已经删除
        /// </summary>
        public bool IsDeleted { get; set; }

        [JsonIgnore]
        /// <summary>
        /// 店铺
        /// </summary>
        public List<Store> Stores { get; set; }

        /// <summary>
        ///子级类别
        /// </summary>
        public List<StoreCategory> Childs { get; set; }

        [JsonIgnore]
        /// <summary>
        /// 父级类别
        /// </summary>
        public StoreCategory? Parent { get; set; }
    }
}
